package com.sai.jsai.common.starter.web.configuration;

import com.sai.jsai.common.starter.web.handler.GlobalWebExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author jisai
 * @version 0.0.1
 * @Description TODO
 * @createTime 2024/09/21
 */
@AutoConfiguration
@ConditionalOnWebApplication
public class WebConfiguration {

    @Bean
    @ConditionalOnMissingBean
    GlobalWebExceptionHandler globalWebExceptionHandler() {
        return new GlobalWebExceptionHandler();
    }

}
